
#include <gtest/gtest.h>
#include "pde/EquationSet.h"
#include "base/System.h"
#include "base/EulerSystem.h"
#include "mesh/GeneratedMesh.h"
#include "ic/InitCondition.h"
#include <vtkm/worklet/SurfaceNormals.h>

TEST(system, f2c)
{
	//Id3 dim = { 42,3,0 };
	//GeneratedMesh mesh(dim);
	//mesh.Build();
	//System sys(mesh);
	//
	//auto &f2cLKey = mesh.GetF2CLKey();
	//auto counts = f2cLKey.GetCounts();
	//auto a = counts.GetNumberOfValues();
	//EXPECT_EQ(f2cLKey.GetUniqueKeys().GetNumberOfValues(), dim[0]*dim[1]);

}

TEST(system, test)
{
	Id3 dim = { 100,100,100 };
	GeneratedMesh mesh(dim);
	//mesh.Build();

	System<5> sys(mesh);
	//sys.Projection();
	
	//auto var = sys.GetCellField("p");
	//EXPECT_EQ(var.GetData().GetNumberOfComponents(), 1);
	//EXPECT_EQ(var.GetNumberOfValues(), dim[0] * dim[1] *1);

	//auto data = var.GetData().Cast<ArrayHandle<FloatDefault>>();
	//EXPECT_FLOAT_EQ(data.ReadPortal().Get(0), vtkm::Sin(vtkm::TwoPi() * 1./dim[0]/2.));

	//sys.Solve();
	//sys.Output();
}


TEST(EulerSystem, test)
{
	Id3 dim = { 100,100,0 };
	GeneratedMesh mesh(dim, { -10,-10,0 }, {10,10,0});
	mesh.Build();

	std::shared_ptr<SystemBase> sys = std::make_shared<EulerSystem>(mesh);
	//EulerSystem sys1(mesh);
	sys->Projection();

	sys->Solve();
}
